<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>tab切换</title>
    <script src="scripts/vue.js" type="text/javascript" charset="UTF-8"></script>    
    <link rel="stylesheet" href="scripts/layui/css/layui.css"  media="all">
    <style type="text/css">
    #pane{
        width:450px;
        height:700px;
        background: skyblue;
    }
    #content{
        margin-left: 10px;
        margin-top: 30px;
        width:430px;
        height:600px;
        background: white;
    }

    </style>
</head>
<body>
    <div id="app">
        <div v-show="vshow" id="pane">   
            <div id="content">

                <h3 v-show="pageType==1">首页</h3>
                <h3 v-show="pageType==2">商城</h3>
                <h3 v-show="pageType==3">我的</h3>
            </div>
            <input type="button" class="layui-btn layui-btn-normal layui-btn-radius" @click="ShowPage" data-id="1" data-sort="3" value="首页">    
            <input type="button" class="layui-btn layui-btn-normal layui-btn-radius" @click="ShowPage" data-id="2" data-sort="2" value="商城">    
            <input type="button" class="layui-btn layui-btn-normal layui-btn-radius" @click="ShowPage" data-id="3" data-sort="1" value="我的">    
        </div>
        
    </div>    

    <script type="text/javascript">
    let app=new Vue({
        el:"#app",
        data:{
            vshow:true,
            pageType:1
        },
        methods:{
             ShowPane:function() {                
                    app.vshow=!app.vshow;                
            },
            ShowPage:function(e){      
                console.log(e.target.dataset)
                let tabid=e.target.dataset.id;
                this.pageType=tabid;
            }
        }
    });
    </script>
</body>
</html>